package display;

import option.Data;

import javax.swing.*;
import java.awt.*;

public class GameFrame extends JFrame {
    private MenuPanel menuPanel = new MenuPanel();/*创建菜单*/
    private BodyPanel bodyPanel = new BodyPanel();/*创建主界面*/

    public GameFrame() {
        this.setIconImage(new ImageIcon("src/image/lei.jpg").getImage());
        this.setTitle("扫雷");/*设置标题*/
        this.setSize(100+35* Data.x, 190+36*Data.y);/*设置窗口长宽*/
        this.setResizable(false);/*窗口不可缩放*/
        this.setLocationRelativeTo(null);/*窗口居中*/
        this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);/*关闭窗口终止进程*/
        this.setLayout(new BorderLayout(0,0));/*窗口布局*/
        this.add(bodyPanel, BorderLayout.CENTER);
        this.add(menuPanel, BorderLayout.NORTH);
    }
}